1. Field of the Invention
The present invention relates to a program, a decoding device, a decoding method, and a recording medium, and particularly relates to a program, a decoding device, a decoding method, and a recording medium, suitable for performing scrub reproduction.
2. Description of the Related Art
There is known a technique wherein MPEG moving picture data is encoded such that not only is compressed data is generated but also sub-data such as index data is generated, which enables special playing to be performed wherein playing is started from a predetermined screen at the time of decoding and playing the compressed data, by making reference to the sub-data (e.g., see Japanese Unexamined Patent Application Publication No. 11-341437).
A player device 1 according to the related art, which is capable of decoding stream data encoded with MPEG2 LongGOP using index data, will be described with reference to FIG. 1.
An operating input obtaining unit 21 obtains user operation input. The operating input obtaining unit 21 receives selection of a stream to be decoded and specification of a play start position from the user, and supplies this to a stream decoding position detection processing unit 22.
The stream decoding position detection processing unit 22 obtains the Stream No. of the stream to be played and the Frame No. of the position to start playing, based on the selection of the stream to be decoded that is supplied from the operation input obtaining unit 21 and the specification of the play start position, and supplies these to a stream supply control unit 23.
The stream supply control unit 23 obtains various types of information necessary for decoding the corresponding stream stored in an index managing unit 24, based on the Stream No. of the stream to be played and the Frame No. of the position to start playing, and detects a reference image frame necessary for decoding the frame of the specified start playing position. The stream supply control unit 23 requests a stream memory control unit 25 for stream data necessary for decoding, and supplies the stream data supplied from stream memory 26 via the stream memory control unit 25, to a decoder 28. Also, the stream supply control unit 23 supplies the Frame No. of the output frame to a later-described base band signal processing unit 32.
The stream memory control unit 25 is for controlling storage at the stream memory 26, and reads out the stream data request by the stream supply control unit 23 from the stream memory, and outputs this to the stream supply control unit 23.
The stream memory 26 stores the stream data, and outputs predetermined stream data under the control of the stream memory control unit 25.
The decoder 28 has a memory control unit 41 built in, this memory control unit 41 being used to control reference base band image memory 29 so as to decode stream data supplied form the stream supply control unit 23 and supply the decoded base band image data to a base band image data memory control unit 30.
Specifically, in the event that the supplied compressed stream is a compressed stream compressed by inner-frame reference, the decoder 28 decodes the compressed stream by causing the reference base band image memory 29, under control of the memory control unit 41, to hold a reference image necessary for subsequent decoding.
The base band image data memory control unit 30 supplies the decoded base band image data supplied form the decoder 28 to base band image data memory 31, reads the base band image data of the frame indicated by the Stream No. and Frame No. requested by the base band signal processing unit 32 from the base band image data memory 31, and supplies this to the base band signal processing unit 32.
The base band signal processing unit 32 performs various types of correction on the supplied base band image data, such as color correction and size correction, field control for slow playback and so forth, for example, such that the decoded image will be properly output, and outputs the generated output base band image data.
Next, the playback processing executed at the player device 1 shown in FIG. 1 in the related art will be described with reference to FIG. 2.
In step S1, the stream decoding position detection processing unit 22 receives input of play position specification (Stream No. and Frame No.) from the operating input obtaining unit 21, and supplies this to the steam supply control unit 23.
In step S2, the stream supply control unit 23 obtains an index table corresponding to the supplied Stream No. from the index managing unit 24.
In step S3, the stream supply control unit 23 extracts information necessary for decoding, such as picture type, information relating to reference image, data length and so forth, for example from the index table.
In step S4, the stream supply control unit 23 obtains the Frame No. of frames necessary as a reference images for decoding the frame of the specified Frame No. (in the event that the frame specified as the frame to be decoded is not an I picture, at least one frame including the immediately preceding I picture), and information for decoding these.
In step S5, the stream supply control unit 23 requests the stream memory control unit 25 for reference images and frames necessary as images to be decoded. The stream memory control unit 25 reads out reference images and frames necessary as images to be decoded from stream memory 26, and supplies these to the stream supply control unit 23.
In step S6, the stream supply control unit 23 supplies the supplied frame data to the decoder 28. The decoder 28 decodes the supplied data. Specifically, upon decoding a reference image necessary in subsequent decoding, the decoder 28 causes the reference base band image memory 29, under control of the memory control unit 41, to hold the base band image data generated by decoding, and uses this as a reference image, thereby decoding a compressed stream. At this time, in the event that the decoder 28 receives an unneeded B frame, decoding of the B picture is skipped (in the event that the necessary frame can be decoded without decoding the supplied B picture).
Next, in step S7, the decoder 28 supplies the decoded base band image data to the base band image data memory control unit 30. The base band image data memory control unit 30 supplies the decoded base band image data supplied from the decoder 28 to the base band image data memory 31, and reads out the base band image data from frame indicated by the Stream No. and Frame No. requested by the base band signal processing unit 32, to the base band signal processing unit 32. The base band signal processing unit 32 performs various types of correction on the supplied base band image data, such as color correction and size correction, field control for slow playback and so forth, for example, such that the decoded image will be properly output, and outputs the generated output base band image data.
Next, scrub playback (also called “random playback”) for playing a predetermined frame specified by a user will be described with reference to FIG. 3, using an example wherein frame B13 and frame B3 are output in that order with the player device 1 which has been described with reference to FIGS. 1 and 2.
The stream decoding position detection processing unit 22 receives input from the operating input obtaining unit 21 of the Stream No. of the stream to be decoded and the Frame Nos. of B13 and B3 which have been specified as frames to be played (output), and supplies these to the stream supply control unit 23.
The stream supply control unit 23 first requests the stream memory control unit 25 for a stream in temporal order including I2, P5, P8, P11, and P14, which are frames necessary as reference images for decoding B13 which is to be output first, and B13 which is the frame to be played (output). The stream supply control unit 23 supplies these to the decoder 28.
The decoder 28 decodes the supplied data in order (decoding of B pictures can be skipped as necessary), sets P11 and P14 in the reference base band image memory 29, under control of the memory control unit 41, and uses these as reference images to decode B13. The decoder 28 supplies base band image data corresponding to the decoded B13 to the base band image data memory control unit 30, and holds in the base band image data memory 31 (i.e., copies to the memory). Various types of correction are performed at the base band signal processing unit 32 (base band processing), and output base band image data is output.
The stream supply control unit 23 then requests the stream memory control unit 25 for a stream in temporal order including I2 and P5, which are frames necessary as reference images for decoding B3 which is to be output secondly, and B3 which is the frame to be played (output). The stream supply control unit 23 supplies these to the decoder 28.
The decoder 28 decodes the supplied data in order, sets I2 and P5 in the reference base band image memory 29, under control of the memory control unit 41, and uses these as reference images to decode B3. The decoder 28 supplies base band image data corresponding to the decoded B3 to the base band image data memory control unit 30, and holds in the base band image data memory 31 (memory copy). Various types of correction are performed at the base band signal processing unit 32 (base band processing), and output base band image data is output.
This sort of processing has been used to perform scrub playback with the player device 1 according to the related art.